<template>
    <van-popup  position="bottom" :overlay="true" v-model="showArea">
             <van-tree-select
                :items="items"
                :main-active-index="mainActiveIndex"
                :active-id="activeId"
                @navclick="onNavClick"
                @itemclick="onItemClick"
            />
    </van-popup>
</template>
<script>

    export default{
        name:'popupTreeSelect',
        props:{
            items:{
                type:Array,
                default:function(){
                    return []
                }
            }
        },
        data() {
            return {
            // 左侧高亮元素的index
            mainActiveIndex: 0,
            // 被选中元素的id
            activeId: 1001,
            showArea:false
            };
        },
        methods: {
            onNavClick(index) {
            this.mainActiveIndex = index;

            },
            onItemClick(data) {
            this.activeId = data.id;
            this.$emit('getJob',data.text)
            }
        }
    }
</script>
